#ifndef OPENGLPAINTER_H
#define OPENGLPAINTER_H

#include <QPixmap>
#include <QPainter>
#include <QPainterPath>
#include <QtOpenGL/QOpenGLPaintDevice>
#include <QtOpenGL/QOpenGLFramebufferObject>
#include <QOffscreenSurface>
#include <QOpenGLFunctions>
#include <QOpenGLExtraFunctions>
#include <QOpenGLContext>
#include <QDebug>
#include <QOpenGLBuffer>

class OpenGLPainter
{
public:
    OpenGLPainter();

    ~OpenGLPainter();

    QImage Paint();

private:
    QSize drawSize = QSize(1024, 768);
    QOpenGLContext *context = nullptr;
    QOpenGLFunctions *f = nullptr;
    QOpenGLExtraFunctions *ef = nullptr;
    QOffscreenSurface *surface = nullptr;
    QOpenGLPaintDevice *device = nullptr;
    QOpenGLFramebufferObject *fbo = nullptr;
    QOpenGLFramebufferObject *resolveFbo = nullptr;
    GLuint pbo = 0;
    uint32_t* data = nullptr;
};

#endif // OPENGLPAINTER_H
